package br.com.androidblog;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import br.com.androidblog.database.DataBaseConnector;

import android.content.Context;
import android.database.Cursor;

public class CursoModel extends DataBaseConnector {

	public CursoModel(Context ctx) {
		super(ctx);
	}

	public void insertCurso(HashMap<String, String> c, String tableName, Context ctx) throws Exception{
		Iterator i = c.entrySet().iterator();

		HashMap<String, String> hs = new HashMap<String, String>();

		while(i.hasNext()) {
			Map.Entry me = (Map.Entry)i.next();
			hs.put(me.getKey().toString(), me.getValue().toString());
		} 
		this.addElements(ctx, tableName, hs);
	}

	public Cursor consultarCurso(Context ctx, String tableName, String[] returnElements, String orderBy) {
		return this.search(ctx, tableName, returnElements , orderBy);
	}
	
}
